
"""Tests for the model module"""


import json
import socket
import time
import unittest
from gaweb import consts
from gaweb.master import excepts
from gaweb.master import model


class MasterTest(unittest.TestCase):
    
    def test_init_scheduler(self):
        d = {}
        def scheduler(*args, **kwargs):
            d['args'] = args
            d['kwargs'] = kwargs
        master = model.Master(scheduler=scheduler)

        self.assertTrue(len(d) > 0)  # "was called" test
        self.assertEqual(d['args'][0], master._do_cleanup)
        self.assertEqual(d['args'][1], consts.TIMEOUT_CHECK_INTERVAL)
        self.assertEqual(d['kwargs'].get('repeat'), True)        




if __name__ == '__main__':
    main()
